================================================================================ = What's Going On Here? ================================================================================ HTML Mode is for editing HyperText Markup Language documents (suffix ".html"). It is not a previewer, nor is it a verifier. If you don't know about HTML or the WorldWideWeb, FTP to ftp.netscape.com and pick up their "Netscape" client to start with. Run it and click on the interesting buttons. One of the fundamental concepts behind this HTML environment is to avoid use of the mouse unless it's really advantageous. Too many environments slow down your work, and hurt your hands, by forcing you to go back and forth between mouse and keyboard. When you use this package, by default you will see bullet characters (Ñ, option-8) being dribbled near where you insert elements. These are supposed to be a feature. The tab key takes you to the next one. For example, if you insert a header, the cursor will be inside the header element, with a bullet after it. Type in the header text and hit tab to go to the bullet (and automatically delete the bullet). If you like, you may ignore the bullets and at any time either press cmd-tab or select "Remove Marks" from the HTML menu to eliminate all of them. If you never want these at all, turn off the flag htmlUseTabMarks (see the section on User-Settable Variables). Without Pete Keleher's ongoing development of Alpha this wouldn't have been possible in the first place. I am also indebted to the authors of the original html.el for GNU Emacs and latex.tcl for Alpha, from whom I originally took ideas and some tcl code. I want feedback. I'm Scott Brim . This is "opinionware" -- if you use it regularly, you should tell me your opinion. If you want to hear about beta releases, send me mail and I'll put you on the list. =============================================================================== = The HTML Menu =============================================================================== Headers - Insert section headers, from H1 to H6. Text Blocks - These are various text-blocks. Not all are here, since some have enough importance to merit their own sections. However paragraph (

) is one to note under here. Styles - Emphasis, etc. Links - Hypertext links TO and FROM other points, plus images. Lists - All kinds. Forms - The elements for building forms. Tables - The elements for building tables. Character Entities - The entities for characters, for example ƒ is ü. The "short" list at the top can be added to with the "Add" item. All possible entities are on the "all" menu. Other Elements - Things which don't fit elsewhere. Select Container - Selects matching tags which include the current selection. Repeated, it expands the selection. Like the "Balance" item under the Edit menu. Untag - Removes a tag pair surrounding the current position or selection. Remove Marks - Removes the Ñ's throughout the document. New doc template - Produces , and elements. URLs - Everything for managing the URL cache. HTML mode accumulates a list of the URLs you use in your HREFs, and saves the list across invocations of Alpha (so it can help you to put in new URLs rapidly). After a while this list can get large. When you select "Clean up" you will be presented with a list. Use the mouse to shift-click and select the URLs you want to keep. The rest will be expunged. If you select text, or copy text from another application into the Mac clipboard, you can insert this into the URL cache as a new URL. Use Attributes - You don't have to be asked about all possible attributes for every element. You can select which ones you want to be asked about. HTML Mode comes configured to ask about the most popular ones. HTML Helpers - You can launch various applications to view/check your HTML. ================================================================================ = Key Bindings ================================================================================ If you are using the default options, almost all key bindings are on control-option, except for a few conflicts which I put on shift-control-option and a few miscellaneous ones. Here are the bindings, with comments, straight from html.tcl. # # new file template and headers # ctl-opt-0 NewTemplate # 0 before any headers ctl-opt-1 Header1 ctl-opt-2 Header2 ctl-opt-3 Header3 ctl-opt-4 Header4 ctl-opt-5 Header5 ctl-opt-6 Header6 # # Blocks # ctl-opt-Return Paragraph Enter Paragraph # for powerbooks ctrl-M Paragraph ctl-opt-; Comment ctl-opt-a Address ctl-opt-q Blockquote # q for quote ctl-opt-p Preformatted # CENTER doesn't have a binding, since it will most likely go away # # Styles # ctl-opt-e Emphasized ctl-opt-s Strong ctl-opt-b Bold ctl-opt-c Code ctl-opt-v Varname shift-ctl-opt-c Cite ctl-opt-k Keyboard ctl-opt-i Italic ctl-opt-f TT # # Links # ctl-opt-, Anchor # "<" is something pointed at ctl-opt-. Href # ">" points to it ctl-opt-/ Image # "/" is right next to ">" # # Lists # ctl-opt-u Bulleted (UL) ctl-opt-o Numbered (OL) ctl-opt-d Directory ctl-opt-m Menu ctl-opt-n ListEntry # n is for 'eNtry' ctl-opt-g BuildDiscList # g is for 'Glossary' shift-ctl-opt-n DiscEntry # N, eNtry with shift key # # Forms # shift-ctl-opt-f Form shift-ctl-opt-s Select shift-ctl-opt-o Option shift-ctl-opt-i Input shift-ctl-opt-t Textarea # # Character entities # # Only <, > and & are bound, to shift-cmd-opt- # The other entities can only be accessed from the menu. shift-ctl-opt-, LessThan shift-ctl-opt-. GreaterThan shift-ctl-opt-7 Ampersand # # Other # ctl-opt-! linebreak # shift-ctl-opt-1 for
ctrl-C L commentline # for internal aesthetics # # Miscellaneous # cmd-B select container shift-ctl-opt-u untag around the selection cmd-shift-s launch a browser Tab TabNext Shift-Tab TabPrevious ================================================================================ = Other Possible Key Bindings ================================================================================ It is possible to change the keybindings in two ways. First, by changing the variables htmlPrefixString and htmlSPrefixString (see below, and remember to change the Menu-related strings as well). Second, by using the Alpha 'bind' command. Here are some simple bindings, included as samples of what is possible. For example, if you are using an international keyboard to produce German HTML, you might put these lines in your prefs.html (under the Edit menu). For more complicated examples see the html.tcl source. bind 0x27 {insertText "Ä\;"} "HTML" bind 0x27 {insertText "ä\;"} "HTML" bind 0x29 {insertText "Ö\;"} "HTML" bind 0x29 {insertText "ö\;"} "HTML" bind 0x21 {insertText "Ü\;"} "HTML" bind 0x21 {insertText "ü\;"} "HTML" bind 0x1b {insertText "ß\;"} "HTML" ================================================================================ = User-Settable Flags and Variables ================================================================================ HTML mode is highly customizable. You can modify its behavior in one of three ways. If you don't know what any of the following means, ignore it for now. You will eventually. (1) Most HTML variables are simple things, for example the number of entries you want in a new discursive list. Almost all are set by using the Flags menu (click on the little flag on the side of the window the HTML file is in -- if you don't see the mode's flags and variables, select "Mode Info" near the bottom of the menu and try again). FLAGS ----- wordWrap - Newlines are automatically inserted as you type. The default is 1, lines will be wrapped. prefixString - The string to begin an HTML comment, and the one to suffixString - end a comment. Generally a bad idea to change these. useStatusBar - If an element has attributes, and this is set, the attributes will be asked about in the status bar. Otherwise they will be asked about in popup prompt windows. The default is 0, do not use the status bar. When using popups, an attribute can be skipped by clicking "cancel" or pressing cmd-.. When using the status bar, at any point pressing cmd-v will paste the contents of the clipboard. Also, at any point the tab key will match what you have typed against your options, and complete what you have typed as much as possible. For example, when prompted with "align=", you can type "m" and tab, and Alpha will fill in "iddle". When you are entering a URL, if you hit tab twice in a row, you will be presented with a menu of URLs you have used before. To approve the selection press return. You can also back up over what has been filled in and change it. Try the tab key even when nothing is showing. Understanding how best to use it takes some use. promptNoisily - If useStatusBar is set, Alpha will beep when asking for element attribute information there. The default is 1, do beep. useLowerCase - If 0, elements will be like

; if 1, like

. The default is 0, upper case. useTabMarks - If 0, will not insert the Ñ characters. The default is 1, to insert them. allContainers - If set,

,

  • , and
    have corresponding closing tags. If not set the optional closing tags are skipped. The default is 1, make them containers. browseInForeground - if set, when you send a file to the browser, the browser will be brought to the foreground. If you have lots of screen space and are just validating, uncheck this flag to leave the browser in the background and Alpha in the foreground. The default is 1, bring browser to foreground. Most browsers will *only* launch in the foreground when they are first brought up, regardless of your flag setting. This is not an Alpha bug. VARIABLES --------- DLEntries - The default number of DD/DT entries for a new discursive list. The default is 3. URLAttrs - Element attributes which are URLs and will involve the URL cache. If you modify it, don't forget the "="s. Most easily modified as in (3) below. quotedAttrs - Element attributes which must usually be in quotation marks. If you modify it, don't forget the "="s. Most easily modified as in (3) below. htmlBindPrefix - The control keys for most keybindings. Default is control-option. htmlSBindPrefix - The control keys for most other keybindings. Default is shift-control-option. htmlMenuPrefix - This is the string which controls the icons to show in the HTML menu for commands bound with htmlBindPrefix. The default is " Edit prefs.html). You need to add to some list and array variables. Some are available through the flag menu to the right of the edit window, but it's difficult to edit these there. Do everything in upper case! When you're done, send your additions to me! HTMLmodeVars(quotedAttrs) - attributes which require quotation marks around them. A list. HTMLmodeVars(URLAttrs) - attributes which take URLs as values. A list. HTMLmodeVars(elemAttrsForAll) - All elements are allowed to have these attributes. They will not be prompted for unless they are in HTMLElemAttrChoices for an element being built. A list. HTMLwords - keywords which should be highlighted when editing HTML in Alpha. A list. htmlElemAttrAll - An array of all known HTML Elements. Each entry is a list of attributes for that element. For example htmlElemAttrAll(FORM) is {ACTION= METHOD= ENCTYPE=}. Be sure to include the trailing = if an attribute takes values. htmlElemAttrChoices - An array. Each entry is an element name, and the content is all of the choices for those attributes which have limited ones. If a value can be anything, e.g. NAME="frob", it won't be here. However, htmlElemAttrChoices(IMG) is {ALIGN=TOP ALIGN=MIDDLE ALIGN=BOTTOM}. Include all attributes for which there are choices. The entry for INPUT has all possibilities for TYPE and ALIGN. htmlElemAttrUsed - This is the array of attributes you want to be prompted for each time. Usually you don't change it explicitly. Use the menu selection "Use Attributes". =============================================================================== = Custom Menu Entries =============================================================================== There is a top-level entry in the HTML menu, "Custom", under which you may add new elements -- or any other procedures -- by adding some simple TCL code to your userStartup.tcl (under the Utils menu, userStartup -> Edit). First, define the list of elements to be listed in the menu. Do this by setting the variable htmlCustomMenuList. For example: set htmlCustomMenuList {"Blink" "Style" "Frob"} Then define the procedures to execute when these items are selected. HTML Mode offers 4 utility procedures which you can use: htmlBuildElem, htmlBuildCRElem, htmlBuildCR2Elem, and htmlOpenElem. The first three create opening and closing tags, while htmlOpenElem just creates a single tag. htmlBuildElem surrounds the element with no whitespace; htmlBuildCRElem puts it on its own line, and htmlCR2Elem surrounds it with blank lines. They all insert the resulting element in the document EXCEPT htmlOpenElem, where you must use insertText yourself. The procedure name HTML mode will look for will be "htmlElem" followed by the exact name in your menu entry. So here are some sample procedures: proc htmlElemBlink {} { htmlBuildElem BLINK } proc htlmElemStyle {} { htmlBuildCRElem STYLE } proc htmlElemFrob {} { insertText [htmlOpenElem FROB] } Of course you can make your procedures as complex as you like. The customization will use any attribute lists you might build, so for example you could have (as described under User-Settable Flags and Variables): set htmlElemAttrAll(FROB) {ALIGN= SELECTOR POINTED} set htmlElemAttrChoices {ALIGN=BOTTOM ALIGN=MIDDLE ALIGN=TOP} set htmlElemAttrUsed {ALIGN= POINTED}